Skip to main content

Geocode (Rupantor)

Geocode (Rupantor)

Validate and format addresses with completeness status and confidence score. Returns standardized address format. Use for checkout validation, delivery verification, and CRM data cleaning.

note

Uses 2 API calls internally.

Usage

import { createBarikoiClient } from "barikoiapis";

const barikoi = createBarikoiClient({
apiKey: "YOUR_BARIKOI_API_KEY",
});

const result = await barikoi.geocode({
q: "house 23, road 5, mirpur dhaka",
district: "yes",
bangla: "yes",
});

const status = result.data?.address_status;
const confidence = result.data?.confidence_score_percentage;
const fixed = result.data?.fixed_address;

Response

This API returns:

given_address, fixed_address, bangla_address, address_status, geocoded_address, confidence_score_percentage, status

Parameters

ParameterTypeDescription
qstringRequired. The address query string
thana"yes" | "no"Include thana in response
district"yes" | "no"Include district in response
bangla"yes" | "no"Include Bangla address translation

Example with Thana

const result = await barikoi.geocode({
q: "barikoihq",
thana: "yes",
});

const geocodedAddress = result.data?.geocoded_address;
console.log(geocodedAddress?.thana);
Type Definitions
export type GeocodeParams = {
q: string;
thana?: "yes" | "no";
district?: "yes" | "no";
bangla?: "yes" | "no";
};

export type GeocodeSuccess = {
given_address?: string;
fixed_address?: string;
bangla_address?: string;
address_status?: "complete" | "incomplete";
geocoded_address?: {
id?: string | number;
Address?: string;
address?: string;
address_bn?: string;
alternate_address?: string;
area?: string;
area_bn?: string;
bounds?: string | null;
business_name?: string | null;
city?: string;
city_bn?: string;
created_at?: string;
district?: string;
geo_location?: Array<number>;
holding_number?: string | null;
latitude?: string;
location?: string;
location_shape?: string;
longitude?: string;
match_freq?: number;
match_fuzzy?: number;
matching_diff?: number;
new_address?: string;
pType?: string;
place_code?: string;
place_name?: string | null;
popularity_ranking?: number;
postCode?: string | number;
postcode?: string | number;
road_name_number?: string | null;
score?: number;
subType?: string;
sub_area?: string | null;
sub_district?: string;
sub_type?: string;
super_sub_area?: string | null;
thana?: string;
type?: string;
uCode?: string;
union?: string | number | null;
unions?: string | number | null;
updated_at?: string;
user_id?: number;
};
confidence_score_percentage?: number;
status?: number;
};
Check other optional parameters for Geocode (Rupantor)